// pages/results/results.js
var app = getApp();
Page({
  data: {
    days:1,
    index:0,
    number:0,
    time:"",
    remark: ["好极了！你很棒棒哦", "哎哟不错哦", "别灰心，继续努力哦！"], // 评语
  },
  onLoad: function (options) {
    let that=this
    console.log(options);
    if(options.updata){
    }else{
      app.globalData.changeDays=false;
      console.log(app.globalData.changeDays)
      wx.setStorageSync('addList', {})
      let openid=wx.getStorageSync('openid');
      let recite=[]
      let reciteItem={}
      reciteItem.data_index=options.data_index
      reciteItem.number=options.number
      reciteItem.pre_index=options.pre_index
      // recite = Object.assign({},reciteItem);
      // test=that.data.questionList.test
      recite.push(reciteItem)
      console.log(recite)
      wx.cloud.callFunction({
        name:"updata",
        data:{
          action:"userList_recite_update",           
          openid:openid,
          recite:recite
        }
      })
    }
  },
  //上传数据
  // 返回首页
  toIndex: function () {
    wx.switchTab({
      url: '../index/index',
    })({
      url: '../home_0/home_0',
    })
  },
})